#!/usr/bin/python
"""
ssh-fwknop (c) Rich Lundeen 2009

This file contains global constants that can be used to enumerate through
the ssh and fwknop options

on version releases, these need to be checked and possibly updated -
hopefully this is the only thing that needs to be updated for new versions
or new supported programs

these are declared just how getopt likes them
"""



class alloptions():
  def __init__(self, optionclass):
    self.optionclass = optionclass
    print "options class is ",optionclass
    if optionclass == "fwknop": 
      #fwknop options
      self.shortopts_noarg = "lqsThVvr"
      self.shortopts_arg   = "d:A:a:R:t:u:D:"
      self.longopts_arg    = [
                "Destination=", "Access=", "allow-IP=", "Resolve-external-IP=", "NAT-access=",
                "URL=",  "gpg-agent-info=", "gpg-home-dir=", "gpg-recipient=", "gpg-signing-key=",
                "Home-dir=", "Last-host=", "Server-port=", "Save-packet-file=",
                "time-offset-plus=", "time-offset-minus=",  "Show-host-cmd=", "Spoof-src=",
                "Spoof-user=", "Max-packet-size=", "Server-cmd=", "offset=",  "Server-mode=",
                "time-delay=", "user-rc="]
      self.longopts_noarg  = [
                 "NAT-local", "gpg-agent","gpg-default-key", "gpg-verbose", "gpg-use-options",
                 "last-cmd", "quiet", "source-ip", "rand-port", "NAT-rand-port", "Save-packet",
                 "Save-packet-append", "Show-last-cmd", "HTTP", "TCP-sock", "help", "Version",
                 "verbose", "locale", "no-locale", "rotate-proto" ]
    elif optionclass == "ssh":
      #ssh options
      self.shortopts_noarg = "1246AaCfgKkMNnqsTtVvXxYb"
      self.shortopts_arg   = "b:c:D:e:F:i:L:l:m:O:o:p:R:S:w:"
      #special case to distinguish fwknop options
      self.longopts_arg    = ["fwknop="]
      self.longopts_noarg  = []
    elif optionclass == "sftp":
      #sftp options - replaces ssh if specified
      self.shortopts_noarg = "1Cv"
      self.shortopts_arg   = "B:b:F:o:P:R:S:s:"
      self.longopts_arg    = ["fwknop="]
      self.longopts_noarg  = []
    elif optionclass == "scp":
      #scp options - replaces ssh if specified
      self.shortopts_noarg = "1246BCpqrv"
      self.shortopts_arg    = "c:F:i:l:o:P:S:"
      self.longopts_arg    = ["fwknop="]
      self.longopts_noarg  = []


